Update parsing to work with the more generic project-felt markdown repo#232
Update parsing to work with the more generic project-felt markdown repo#232jschuler wants to merge 3 commits intopatternfly:mainfrom
Conversation
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughThis PR introduces subsection grouping for navigation entries, adds configurable frontmatter defaults and mappings to the content schema, normalizes section route parameters to kebab-case, and improves CLI error handling by resolving astroRoot relative to the CLI file location. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 21 minutes and 15 seconds.Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
src/components/NavSection.tsx (1)
19-66: 💤 Low valueWell-structured subsection grouping implementation.
The logic correctly partitions entries and renders nested
NavExpandablecomponents. The extractedrenderEntryhelper improves maintainability.Minor consideration: at line 61, the
idattribute uses the rawsubsectionstring. If subsection names contain spaces or special characters (e.g., "AI Guidelines"), the DOM id may be invalid. Consider usingkebabCase(subsection)for consistency:- id={`nav-subsection-${sectionId}-${subsection}`} + id={`nav-subsection-${kebabCase(sectionId)}-${kebabCase(subsection)}`}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/NavSection.tsx` around lines 19 - 66, The DOM id for subsection NavExpandable uses the raw subsection string which can produce invalid ids for names with spaces or special chars; in the NavSection component update the id (and optionally the React key) for the subsection NavExpandable from `nav-subsection-${sectionId}-${subsection}` to use `kebabCase(subsection)` (e.g., `nav-subsection-${sectionId}-${kebabCase(subsection)}`) so ids are normalized and consistent with the other kebabCase usage in renderEntry/active checks.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@cli/cli.ts`:
- Around line 40-41: The build fails because dirname is used but not imported;
update the import that provides fileURLToPath to also import dirname so
dirname(fileURLToPath(import.meta.url)) works correctly when computing cliDir
and resolving astroRoot (look for the import that currently brings in
fileURLToPath and add dirname to it), then re-run typecheck to ensure cliDir and
astroRoot assignments compile.
In `@src/pages/`[section]/[...page].astro:
- Line 60: The rewrite is using the raw section value (entry.data.section) while
route params use kebabCase(entry.data.section), causing mismatched URLs; update
the Astro.rewrite call to use the same kebab-cased section (e.g.,
kebabCase(entry.data.section) or a precomputed const like const sectionSlug =
kebabCase(entry.data.section)) so both params and Astro.rewrite reference the
identical normalized section value (also ensure any other uses of
entry.data.section in this file use the slug variable).
In `@src/pages/`[section]/[page]/[tab].astro:
- Line 67: The template builds URLs using the raw entry.data.section, which can
mismatch the kebab-cased route param set earlier
(kebabCase(entry.data.section)); update the URL constructions that reference
entry.data.section (the links around where you render the page/tab URLs) to use
the kebab-cased value instead — either call kebabCase(entry.data.section) inline
or use the already-normalized section value (kebabCase(entry.data.section))
produced earlier so generated links match the static paths.
---
Nitpick comments:
In `@src/components/NavSection.tsx`:
- Around line 19-66: The DOM id for subsection NavExpandable uses the raw
subsection string which can produce invalid ids for names with spaces or special
chars; in the NavSection component update the id (and optionally the React key)
for the subsection NavExpandable from
`nav-subsection-${sectionId}-${subsection}` to use `kebabCase(subsection)`
(e.g., `nav-subsection-${sectionId}-${kebabCase(subsection)}`) so ids are
normalized and consistent with the other kebabCase usage in renderEntry/active
checks.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 762f1cee-d9cf-4cd5-944b-b05b1804c56d
📒 Files selected for processing (8)
cli/cli.tscli/getConfig.tssrc/components/NavEntry.tsxsrc/components/NavSection.tsxsrc/components/Navigation.astrosrc/content.config.tssrc/pages/[section]/[...page].astrosrc/pages/[section]/[page]/[tab].astro
| ]) | ||
| .optional(), | ||
| }).transform((data) => { | ||
| const result: Record<string, unknown> = { ...data } |
There was a problem hiding this comment.
I'm wondering if this Record<string, unknown> typing on this transform is going to cause issues?
There was a problem hiding this comment.
It’s only for TS's view of the data after applying config-based mapping/defaults
runtime behavior and validation should be unchanged
Found here
https://github.com/project-felt/ai-guidelines
in patternfly-org
pf-docs.config.mjsSummary by CodeRabbit
New Features
Improvements